package com.violet.domain.vo.app;

import com.violet.annotation.transition.TDateTimeFormat;
import com.violet.annotation.transition.TImagePrefix;
import com.violet.domain.vo.VO;
import lombok.Data;

import java.util.List;

@Data
public class AOrderVo implements VO {

    private String id;

    private Double totalPrice;
    private Double totalDiscountAmount;
    private Double finalPrice;

    // 预计送达时间
    private String estimatedDeliveryTime;

    // 下单时间（支付时间）
    @TDateTimeFormat
    private String orderTime;

    // 送达时间
    @TDateTimeFormat
    private String deliveryTime;

    private String status;

    private AOrderAddress address;
    private List<AOrderProduct> products;

    // 订单地址
    @Data
    public static class AOrderAddress implements VO {
        private String name;
        private String phone;
        private String address;
    }

    @Data
    public static class AOrderProduct implements VO {
        private String id;
        private String name;
        private String description;
        private Double currentPrice;
        private Double originalPrice;
        private Integer count;
        private String unit;
        @TImagePrefix
        private String image;
    }
}
